{block name="title" prepend}{$LNG.lm_research}{/block}
{block name="content"}
{if !empty($Queue)}
<div id="buildlist" class="buildlist">
	<table style="width:760px">
		{foreach $Queue as $List}
		{$ID = $List.element}
		<tr>
			<td style="width:70%;vertical-align:top;" class="left">
				{if isset($ResearchList[$List.element])}
				{$CQueue = $ResearchList[$List.element]}
				{/if}
				{$List@iteration}.: 
				{if isset($CQueue) && $CQueue.maxLevel != $CQueue.level && !$IsFullQueue && $CQueue.buyable}
				<form action="game.php?page=research" method="post" class="build_form">
					<input type="hidden" name="cmd" value="insert">
					<input type="hidden" name="tech" value="{$ID}">
					<button type="submit" class="build_submit onlist">{$LNG.tech.{$ID}} {$List.level}{if !empty($List.planet)} @ {$List.planet}{/if}</button>
				</form>
				{else}
				{$LNG.tech.{$ID}} {$List.level}{if !empty($List.planet)} @ {$List.planet}{/if}
				{/if}
				{if $List@first}
				<br><br><div id="progressbar" data-time="{$List.resttime}"></div>
			</td>
			<td>
				<div id="time" data-time="{$List.time}"><br></div>
				<form action="game.php?page=research" method="post" class="build_form">
					<input type="hidden" name="cmd" value="cancel">
					<button type="submit" class="build_submit onlist">{$LNG.bd_cancel}</button>
				</form>
				{else}
			</td>
			<td>
				<form action="game.php?page=research" method="post" class="build_form">
					<input type="hidden" name="cmd" value="remove">
					<input type="hidden" name="listid" value="{$List@iteration}">
					<button type="submit" class="build_submit onlist">{$LNG.bd_cancel}</button>
				</form>
				{/if}
				<br><span style="color:lime" data-time="{$List.endtime}" class="timer">{$List.display}</span>
			</td>
		</tr>
	{/foreach}
	</table>
</div>
{/if}
{if $IsLabinBuild}<table width="70%" id="infobox" style="border: 2px solid red; text-align:center;background:transparent"><tr><td>{$LNG.bd_building_lab}</td></tr></table><br><br>{/if}
<table style="width:780px">
{$td=3}
	{foreach $ResearchList as $ID => $Element}
     {if $td==3}
            <tr>
                <td width="260px">
             {$td=0}
         {else} 
         	<td width="260px">
         {/if}      
            {$td= $td +1}
	<table class="b_box" height="100%">
      <tr>
		<td rowspan="2" style="width:75px;">
			<a href="#" onclick="return Dialog.info({$ID})">
				<img src="{$dpath}gebaeude/{$ID}.gif" alt="" class="top" width="75" height="75">
			</a>
		</td>
		<td>
			<a href="#" onclick="return Dialog.info({$ID})">{$LNG.tech.{$ID}}</a>
            {if $Element.level != 0}<br /> ({$LNG.bd_lvl} {$Element.level}
            {if $Element.elvl > 0} <span style="color:lime;">+{$Element.elvl}</span>{/if}
            {if $Element.maxLevel != 255}/{$Element.maxLevel}{/if}){/if}
		</td>
	</tr>
	<tr style="padding:0;">
		<td>
			<div style="width:100%; text-align: left;">
                <span style="display:block; clear:both; text-align: left">
                    Время: {$Element.elementTime|time}
                </span>
                <span style="clear:both; display:block;">
             		{if $Element.maxLevel == $Element.level}
						<span style="color:red">{$LNG.bd_maxlevel}</span>
					{elseif $IsLabinBuild || $IsFullQueue || !$Element.buyable}
						<span style="color:red">{if $Element.level == 0}{$LNG.bd_tech}{else}Исследовать до {$Element.level + 1}{/if}</span>
					{else}
						<form action="game.php?page=research" method="post" class="build_form">
							<input type="hidden" name="cmd" value="insert">
							<input type="hidden" name="tech" value="{$ID}">
							<button type="submit" class="build_submit">{if $Element.level == 0}{$LNG.bd_tech}{else}Исследовать до {$Element.level + 1}{/if}</button>
						</form>
					{/if}
                    </span>
			</div>
		</td>
	</tr>
	<tr>
		<td colspan="2" style="margin-bottom:10px;">  
			<table style="width:100%">
				<tr>
					
                        {foreach $Element.costRessources as $RessID => $RessAmount}
                        <td class="transparent">                       
                            <img src="{$dpath}images/{$RessID}.gif" alt="{$LNG.tech.{$RessID}}" height="25" /><br />
                                <span style="font-weight:bold; color:{if $Element.costOverflow[$RessID] == 0}lime{else}red{/if}">
                                   	{$RessAmount|number}
                                </span>
						</td>
                        {/foreach}
				</tr>
			</table>
        </td>
      </tr>
    </table>
    {if $td==3}
        </td>
    </tr>
    {else} 
        </td>
    {/if} 
	{/foreach}
    {if $td!=3}
    </tr>
    {/if}
    <tr>
    	<td class="transparent" style="text-align:left" colspan="3">
        	<a href="game.php?page=research&amp;mode=inter">Классический вид</a>
            <br /> Мгновенная покупка за Темную материю <a href="game.php?page=dmtech">[Исследований]</a>
        </td>
    </tr>
</table>
{/block}